﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>_plugin_registercommand</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
html,body { 
	/* Default Font */
	font-family: Courier New;
	font-size: 11pt;
}
</style>

</head>

<body>
<P><STRONG>_plugin_registercommand<BR></STRONG>This 
function registers a command for usage inside scripts or the command bar.</P>
<P><STRONG>bool _plugin_registercommand(</STRONG> <BR><STRONG>int</STRONG> pluginHandle, //plugin 
handle<BR><STRONG>const char*</STRONG> command, 
//command 
name<BR><STRONG>CBPLUGINCOMMAND</STRONG> cbCommand, //function that is 
called when the command is executed<BR><STRONG>bool</STRONG> debugonly //restrict the command to 
debug-only<BR><STRONG>);</STRONG></P>
<P><STRONG>Parameters</STRONG></P>
<P><U>pluginHandle</U>: Handle of the 
calling plugin.</P>
<P><U>command</U>: Command name.</P>
<P><U>cbCommand</U>: Callback with the following 
typedef:<BR>&nbsp;&nbsp;&nbsp; <STRONG>bool 
CBPLUGINCOMMAND(<BR>&nbsp;&nbsp;&nbsp; int</STRONG> argc //argument count 
(number of&nbsp;arguments + 1)<BR>&nbsp;&nbsp;&nbsp; <STRONG>char* 
</STRONG>argv[] //array of arguments (argv[0] is the full command, arguments 
start at argv[1])<BR>&nbsp;&nbsp;&nbsp; <STRONG>);</STRONG> </P>
<P><U>debugonly</U>: When set, the command will never be 
executed when there is no target is&nbsp;being debugged. </P>
<P><STRONG>Return Values<BR></STRONG>This function returns 
true when the command was successfully registered, <U>make sure to check this, 
other plugins may have already registered the same 
command.</U>        
        </P></body>
</html>
